package com.ssh.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.ssh.entity.User;

public class UserDao {
	private SessionFactory factory;

	public SessionFactory getFactory() {
		return factory;
	}

	public void setFactory(SessionFactory factory) {
		this.factory = factory;
	}
    public Session getSession() {
    	return factory.openSession();
    }
    
    public List<User> getUser(){
    	String hql = "from User";
    	return  getSession().createQuery(hql).list();
    }
}
